package com.example.controller.product;

import com.example.pojo.ProductLog;
import com.example.service.product.ProductLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @program: demo
 * @description: 商品日志
 * @author: yc
 * @create: 2022-12-16 14:10
 **/

@Controller
@CrossOrigin
@RequestMapping("/ProductLog")
public class ProductLogController {
    @Autowired
    private ProductLogService service;

    /**
     * @Description: 商品日志
     * @Param: * @param
     * @return: java.util.List<com.example.pojo.ProductLog>
     * @Author: yc
     * @Date: 2022/12/16 14:33
     */
    @ResponseBody
    @RequestMapping("/getProductLog")
    public List<ProductLog> getProductLog(){
        List<ProductLog> productLog = service.getProductLog();
        System.out.println(productLog);
        return productLog;
    }

    /**
     * @Description: 删除商品日志
     * @Param: * @param id
     * @return: void
     * @Author: yc
     * @Date: 2023/2/1 20:21
     */
    @ResponseBody
    @RequestMapping("/delProductLog")
    public void delProductLog(Integer id){
        service.delProductLog(id);
    }

}
    